<?php
namespace App\Http\Controllers\MobileWeb;

use App\Http\Controllers\Business\App\Statistic\StatisticManagement;
use App\Http\Controllers\WebController;
use App\Http\Controllers\Business\Admin\Shop\ShopManagement;
use App\Models\Feedback;
use App\Models\ShopUser;
use Illuminate\Support\Facades\Auth;
use Maatwebsite\Excel\Facades\Excel;
use App\Http\Controllers\Business\App\MyCenter\MyCenter;
use App\Http\Controllers\Business\App\Wallet\Wallet;
//use App\Http\Controllers\Business\App\PublicBusiness;
use App\Http\Controllers\Business\Shop\V1\Auth\ShopAuth;
//use App\Http\Controllers\Business\Shop\V1\PublicBusiness;
use App\Http\Controllers\Business\Shop\V1\Account\Account;
use App\Http\Controllers\Business\Shop\V1\DoubleCalendar\DoubleCalendar;
use App\Http\Controllers\Business\Shop\V1\Salesman\SalesmanManagement;
use App\Http\Controllers\Business\App\PublicBusiness;


class TestController extends WebController
{
    //文风测试
    public function wenFengTest() {
        return view('console.login');
    }
    //黄艳霞测试
    public function huangTest() {
//        $userid =248353;
//        $rechargenumber = '31705191249585924248';
//        $result = Wallet::rechargeDetails($userid,$rechargenumber);
//        dd($result);
//        $userId = 248353;
//        $page = 1;
//        $length = 30;
//        $cityId = 1;
//        $search = '邓';
//        $myLongitude = '';
//        $myLatitude = '';
//        $shopId = 967;
//        $orderNumber = '17060510520395775248';
//        $walletResult = Wallet::orderDetails($userId, $orderNumber);
//        dd($walletResult);



//        $mobile = '15279165248';
//        $type = 'password';
//        $code = '123456';
//        $password = '123456';
//        $result = ShopAuth::loginByV12Version($mobile,$type,$code,$password);
//        dd($result);


//        $shopUserId = '2153';
//        $code = '793881';
//        $password = 'wwwwww';
//        $confirmPassword = 'wwwwww';
//        $result = PublicBusiness::updateUserPassword($shopUserId,$code,$password,$confirmPassword);
//        dd($result);



//        $shopid = '1116';
//        $starttime = '2017-01-15';
//        $lasttime = '2017-01-16';
//        $result = Account::index($shopid,$starttime,$lasttime);
//        dd($result);

//        $shopid = 1116;
//        $mydate = '2017-01-16';
//        $result = Account::orderListByDate($shopid, $mydate);
//        dd($result);

//        $shopId = '1256';
//        $date = '2017-04-27';
//        $page = '1';
//        $result = Account::salesmanWithdrawalList($shopId, $date, $page, $perpage=20);
//        dd($result);




//        $shopid = '1116';
//        $result = PublicBusiness::index($shopid, $shopuserid='');
//        dd($result);

//        $shopId = 1116;
//        $event = array(
//            '2017-06-15',
//            '2017-06-14',
//            '2017-06-16',
//        );
//        $result = DoubleCalendar::setDoubleCalendar($shopId,$event, $shopUserId='');
//        dd($result);

//        $shopUserId = '2158';
//        $shopId = '1471';
//        $result = SalesmanManagement::index($shopUserId, $shopId);
//        dd($result);
//        $cityid = 1;
//        $string = '牛';
//        $result = PublicBusiness::searchShop($cityid,$string,$mylongitude = '',$mylatitude = '');
//        dd($result);



        //将反馈表中的shopid从shop表中导入
//        $data = Feedback::where('type','shop')->get();
//        if(!empty($data)){
//            foreach($data as $key=>$value){
//                $shopUser = ShopUser::where('mobile',$value['mobile'])->first();
//                $shopIdArr = explode(',',$shopUser['shopid']);
//                if(empty($value['shopid']) && isset($shopIdArr[0])){
//                    $result = Feedback::where('id', $value['id'])->update(['shopid'=>$shopIdArr[0]]);
//                    echo $value['id']."&nbsp;&nbsp;&nbsp;";
//                }else{
//                    echo "已经更新完成&nbps;&nbsp;";
//                }
//
//            }
//        }


        $userId = '248324';
        $money = 30;
        $shopId = '1867';
        $result = wallet::getRedEnvelopeMaxAmount($userId, $money, $shopId);
        dd($result);
    }
}
